// 消息推送
import request from '@/utils/http'
import type { BaseResult, PageResult } from '@/types/axios.d'
import type {
  CereNotice,
  NoticeIdParam,
  NoticeParam,
  NoticeGetAllParam
} from '@/api/model/noticeModel'

//消息推送
export function noticeAdd(data: NoticeParam): Promise<BaseResult<null>> {
  return request.post({
    url: '/notice/save',
    data
  })
}

//删除消息
export function noticeDelete(data: NoticeIdParam): Promise<BaseResult<null>> {
  return request.post({
    url: '/notice/delete',
    data
  })
}

//消息详情查询
export function noticeGetById(data: NoticeIdParam): Promise<BaseResult<CereNotice>> {
  return request.post({
    url: '/notice/getById',
    data
  })
}

//分页查询消息列表
export function noticeGetAll(data: NoticeGetAllParam): Promise<BaseResult<PageResult<CereNotice>>> {
  return request.post({
    url: '/notice/getAll',
    data
  })
}
